import java.util.Date;


public class MonitorData
{
	private boolean m_isAlive;
	private String m_ip;
	private String m_host;
	private int m_port;
	private MonitorTypeEnum m_monitorType;
	private String m_parameter;
	private String m_value;
	private Date m_timeStamp;
	private boolean m_isRegister;

	public MonitorData(String ip,String host,MonitorTypeEnum monitorDataType)
	{
		setIP(ip);
		setHost(host);
		setMonitorDataType(monitorDataType);
		setIsRegister(false);
		setIsAlive(true);
	}
	
	public boolean getIsAlive()
	{
		return m_isAlive;
	}
	
	public void setIsAlive(boolean isAlive)
	{
		m_isAlive = isAlive;
	}
	
	public boolean getIsRegister()
	{
		return m_isRegister;
	}
	
	public void setIsRegister(boolean isRegister)
	{
		m_isRegister = isRegister;
	}
	
	public Date getTimeStamp()
	{
		return m_timeStamp;
	}
	
	public void setTimeStamp(Date timeStamp)
	{
		m_timeStamp = timeStamp;
	}
	
	public int getPort()
	{
		return m_port;
	}
	
	public void setPort(int port)
	{
		m_port = port;
	}
	
	public String getIP()
	{
		return m_ip;
	}
	
	public void setIP(String ip)
	{
		m_ip=ip;
	}
	
	public boolean getHasParameter()
	{
		return m_monitorType == MonitorTypeEnum.Ping;
	}
	
	public String getValue()
	{
		return m_value;
	}
	
	public void setValue(String value)
	{
		m_value = value;
	}
	
	public String getParameter()
	{
		return m_parameter;
	}
	
	public void setParameter(String parameter)
	{
		m_parameter = parameter;
	}
	
	public MonitorTypeEnum getMonitorDataType()
	{
		return m_monitorType;
	}
	
	public void setMonitorDataType(MonitorTypeEnum monitorDataType)
	{
		m_monitorType = monitorDataType;
	}

	public String getHost() 
	{
		return m_host;
	}

	public void setHost(String host) 
	{
		m_host = host;
	}
	
	public boolean equals(Object obj)
	{
		if(obj == null)
			return false;
		
		if (!(obj instanceof MonitorData))
			return false;
		
		MonitorData other = (MonitorData)obj;
		return (getHost().equals(other.getHost()) && 
				getMonitorDataType().equals(other.getMonitorDataType()));
	}
	
	public int hashCode()
	{
		String hashCode = getHost() + getMonitorDataType().toString();
		return hashCode.hashCode();
	}
	
}
